<!--
 * @FilePath     : /layui/demo/1571.html
 * @Description  : 默认表单提交
 * @Date         : 2025-02-24 15:46
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-02-24 16:06
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <form class="layui-form">
      <div class="layui-form-item">
        <input
          type="text"
          name="patentName"
          placeholder="请输入"
          autocomplete="off"
          class="layui-input"
          lay-verify="required"
          lay-reqText="当前项必须填写"
        />
      </div>
      <div class="layui-form-item">
        <!-- xm-select DOM 容器 -->
        <div id="demo1" class="xm-select-demo"></div>
      </div>
      <div class="layui-form-item">
        <h2 lay-submit lay-filter="subtwo">点我提交</h2>
      </div>
    </form>

    <script src="/layui/dist/layui.js"></script>
    <script src="/xm-select/dist/xm-select.js"></script>
    <script>
      layui.use(['form', 'jquery'], function () {
        var form = layui.form,
          $ = layui.$

        // 渲染
        var demo1 = xmSelect.render({
          el: '#demo1',
          data: [
            { name: '张三', value: 1, selected: true },
            { name: '李四', value: 2 },
            { name: '王五', value: 3, selected: true },
          ],

          //
        })

        form.on('submit(subtwo)', function (data) {
          console.log(1, data)
          return false
        })
      })
    </script>
  </body>
</html>
